# 作者：一只牛吗
# 2025 年02月 01日 03时 38分 56秒
# 1278599690@qq.com
class Animal:
    def __init__(self, name):
        self.name = name

    def eat(self):
        print(f"{self.name}吃东西")

    def sleep(self):
        print(f"{self.name}睡觉")

    def run(self):
        print(f"{self.name}跑")

    def drink(self):
        print(f"{self.name}喝水")


class Dog(Animal):
    def bark(self):
        print("狗叫")


class Cat(Animal):
    def meow(self):
        print("猫叫")

class XiaoTianQuan(Dog):
    def __init__(self, name):
        super().__init__(name)  # 使用super()方法调用父类的init函数功能

    def fly(self):
        print(f'{self.name}飞')


if __name__ == '__main__':
    dog = Dog('小狗')
    cat = Cat('小猫')
    print(dir(dog))
    print(dir(cat))
    xiaotianquan = XiaoTianQuan('哮天犬')
    xiaotianquan.fly()
